﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Lamex.SIESystemManager.Calculate
{
    public class C_D34
    {
        public double GetD34(DataRow[] dr1, DataRow[] dr2, string Types, string Thickness)
        {
            double TD34 = 0, Tfb = 0, Tbc = 0, Tw1 = 0, Tw2 = 0, Td1 = 0,
                Td2 = 0, Lcd = 0, Tdz = 0, Tpj = 0, Twqk = 0, Tnqk = 0, Txb = 0, Tqx = 0, Tqf = 0, Tld = 0, Nrs = 0;
            double TD34_Coefficient_Width_W1 = 0;//系数阔度W1
            double TD34_Coefficient_Width_W2 = 0;//系数阔度W2
            double TD34_Coefficient_Depth_D1 = 0;//系数深度D1
            double TD34_Coefficient_Depth_D2 = 0;//系数深度D2
            double TD34_Coefficient_Angle_Z = 0;//系数转角Z
            double TD34_Copper_Head_Plug = 0;//D34_打铜头胶塞
            double TD34_Twisted_Tooth_Nut = 0;//D34_拧带齿螺母
            double TD34_Groove_Side_Rubbing = 0;//D34_槽侧边擦色
            double TD34_LOGO = 0;//D34_贴美时LOGO
            double TD34_Mounting_Screen_Hanging_Code = 0;//D34_装屏风挂码
            double TD34_Inside_the_Seal_700 = 0;//D34_封内缺700
            double TD34_Inside_the_Seal_701 = 0;//D34_封内缺701
            double TD34_Seal_Outer_Ear_200 = 0;//D34_封外耳200
            double TD34_Seal_Outer_Ear_400 = 0;//D34_封外耳400
            double TD34_Seal_Outer_Ear_401 = 0;//D34_封外耳401
            double TD34_Outside_Seal_300 = 0;//D34_封外缺300
            double TD34_Outside_Seal_500 = 0;//D34_封外缺500
            double TD34_Outside_Seal_501 = 0;//D34_封外缺501
            double TD34_Decorative_Hole_Cover = 0;//D34_装装饰孔盖
            double TD34_Lock_Self_Tapping_Screw = 0;//锁自攻螺丝
            double TD34_General_Label = 0;//贴通用标签
            double TD34_Paste_White_Adhesive_Paper = 0;//贴白色胶纸
            double TD34_Double_Sided_Adhesive_Paper = 0;//贴双面胶纸

            //单位工时
            double WD34_Coefficient_Width_W1 = 0;//系数阔度W1
            double WD34_Coefficient_Width_W2 = 0;//系数阔度W2
            double WD34_Coefficient_Depth_D1 = 0;//系数深度D1
            double WD34_Coefficient_Depth_D2 = 0;//系数深度D2
            double WD34_Coefficient_Angle_Z = 0;//系数转角Z
            double WD34_Copper_Head_Plug = 0;//D34_打铜头胶塞
            double WD34_Twisted_Tooth_Nut = 0;//D34_拧带齿螺母
            double WD34_Groove_Side_Rubbing = 0;//D34_槽侧边擦色
            double WD34_LOGO = 0;//D34_贴美时LOGO
            double WD34_Mounting_Screen_Hanging_Code = 0;//D34_装屏风挂码
            double WD34_Inside_the_Seal_700 = 0;//D34_封内缺700
            double WD34_Inside_the_Seal_701 = 0;//D34_封内缺701
            double WD34_Seal_Outer_Ear_200 = 0;//D34_封外耳200
            double WD34_Seal_Outer_Ear_400 = 0;//D34_封外耳400
            double WD34_Seal_Outer_Ear_401 = 0;//D34_封外耳401
            double WD34_Outside_Seal_300 = 0;//D34_封外缺300
            double WD34_Outside_Seal_500 = 0;//D34_封外缺500
            double WD34_Outside_Seal_501 = 0;//D34_封外缺501
            double WD34_Decorative_Hole_Cover = 0;//D34_装装饰孔盖 
            double WD34_Lock_Self_Tapping_Screw = 0;//锁自攻螺丝
            double WD34_General_Label = 0;//贴通用标签
            double WD34_Paste_White_Adhesive_Paper = 0;//贴白色胶纸
            double WD34_Double_Sided_Adhesive_Paper = 0;//贴双面胶纸
            //附加工时
            double AD34_Coefficient_Width_W1 = 0;//系数阔度W1
            double AD34_Coefficient_Width_W2 = 0;//系数阔度W2
            double AD34_Coefficient_Depth_D1 = 0;//系数深度D1
            double AD34_Coefficient_Depth_D2 = 0;//系数深度D2
            double AD34_Coefficient_Angle_Z = 0;//系数转角Z
            double AD34_Copper_Head_Plug = 0;//D34_打铜头胶塞
            double AD34_Twisted_Tooth_Nut = 0;//D34_拧带齿螺母
            double AD34_Groove_Side_Rubbing = 0;//D34_槽侧边擦色
            double AD34_LOGO = 0;//D34_贴美时LOGO
            double AD34_Mounting_Screen_Hanging_Code = 0;//D34_装屏风挂码
            double AD34_Inside_the_Seal_700 = 0;//D34_封内缺700
            double AD34_Inside_the_Seal_701 = 0;//D34_封内缺701
            double AD34_Seal_Outer_Ear_200 = 0;//D34_封外耳200
            double AD34_Seal_Outer_Ear_400 = 0;//D34_封外耳400
            double AD34_Seal_Outer_Ear_401 = 0;//D34_封外耳401
            double AD34_Outside_Seal_300 = 0;//D34_封外缺300
            double AD34_Outside_Seal_500 = 0;//D34_封外缺500
            double AD34_Outside_Seal_501 = 0;//D34_封外缺501
            double AD34_Decorative_Hole_Cover = 0;//D34_装装饰孔盖
            double AD34_Lock_Self_Tapping_Screw = 0;//锁自攻螺丝
            double AD34_General_Label = 0;//贴通用标签
            double AD34_Paste_White_Adhesive_Paper = 0;//贴白色胶纸
            double AD34_Double_Sided_Adhesive_Paper = 0;//贴双面胶纸

            //获取单位工时和附加工时
            foreach (var drHours in dr2)
            {
                switch (drHours["OPERATIONAL_NAME"].ToString())
                {
                    case "F系数阔度W1":
                        WD34_Coefficient_Width_W1 = double.Parse(string.IsNullOrEmpty(drHours["UNIT_WORKHOURS"].ToString()) ? "0" : drHours["UNIT_WORKHOURS"].ToString());//单位工时
                        AD34_Coefficient_Width_W1 = double.Parse(string.IsNullOrEmpty(drHours["ATTACH_WORKHOURS"].ToString()) ? "0" : drHours["ATTACH_WORKHOURS"].ToString());//附加工时
                        break;
                    case "F系数阔度W2":
                        WD34_Coefficient_Width_W2 = double.Parse(string.IsNullOrEmpty(drHours["UNIT_WORKHOURS"].ToString()) ? "0" : drHours["UNIT_WORKHOURS"].ToString());//单位工时
                        AD34_Coefficient_Width_W2 = double.Parse(string.IsNullOrEmpty(drHours["ATTACH_WORKHOURS"].ToString()) ? "0" : drHours["ATTACH_WORKHOURS"].ToString());//附加工时
                        break;
                    case "F系数深度D1":
                        WD34_Coefficient_Depth_D1 = double.Parse(string.IsNullOrEmpty(drHours["UNIT_WORKHOURS"].ToString()) ? "0" : drHours["UNIT_WORKHOURS"].ToString());//单位工时
                        AD34_Coefficient_Depth_D1 = double.Parse(string.IsNullOrEmpty(drHours["ATTACH_WORKHOURS"].ToString()) ? "0" : drHours["ATTACH_WORKHOURS"].ToString());//附加工时
                        break;
                    case "F系数深度D2":
                        WD34_Coefficient_Depth_D2 = double.Parse(string.IsNullOrEmpty(drHours["UNIT_WORKHOURS"].ToString()) ? "0" : drHours["UNIT_WORKHOURS"].ToString());//单位工时
                        AD34_Coefficient_Depth_D2 = double.Parse(string.IsNullOrEmpty(drHours["ATTACH_WORKHOURS"].ToString()) ? "0" : drHours["ATTACH_WORKHOURS"].ToString());//附加工时
                        break;
                    case "F系数转角Z":
                        WD34_Coefficient_Angle_Z = double.Parse(string.IsNullOrEmpty(drHours["UNIT_WORKHOURS"].ToString()) ? "0" : drHours["UNIT_WORKHOURS"].ToString());//单位工时
                        AD34_Coefficient_Angle_Z = double.Parse(string.IsNullOrEmpty(drHours["ATTACH_WORKHOURS"].ToString()) ? "0" : drHours["ATTACH_WORKHOURS"].ToString());//附加工时
                        break;
                    case "封内缺700":
                        WD34_Inside_the_Seal_700 = double.Parse(string.IsNullOrEmpty(drHours["UNIT_WORKHOURS"].ToString()) ? "0" : drHours["UNIT_WORKHOURS"].ToString());//单位工时
                        AD34_Inside_the_Seal_700 = double.Parse(string.IsNullOrEmpty(drHours["ATTACH_WORKHOURS"].ToString()) ? "0" : drHours["ATTACH_WORKHOURS"].ToString());//附加工时
                        break;
                    case "封内缺701":
                        WD34_Inside_the_Seal_701 = double.Parse(string.IsNullOrEmpty(drHours["UNIT_WORKHOURS"].ToString()) ? "0" : drHours["UNIT_WORKHOURS"].ToString());//单位工时
                        AD34_Inside_the_Seal_701 = double.Parse(string.IsNullOrEmpty(drHours["ATTACH_WORKHOURS"].ToString()) ? "0" : drHours["ATTACH_WORKHOURS"].ToString());//附加工时
                        break;
                    case "封外耳200":
                        WD34_Seal_Outer_Ear_200 = double.Parse(string.IsNullOrEmpty(drHours["UNIT_WORKHOURS"].ToString()) ? "0" : drHours["UNIT_WORKHOURS"].ToString());//单位工时
                        AD34_Seal_Outer_Ear_200 = double.Parse(string.IsNullOrEmpty(drHours["ATTACH_WORKHOURS"].ToString()) ? "0" : drHours["ATTACH_WORKHOURS"].ToString());//附加工时
                        break;
                    case "封外耳400":
                        WD34_Seal_Outer_Ear_400 = double.Parse(string.IsNullOrEmpty(drHours["UNIT_WORKHOURS"].ToString()) ? "0" : drHours["UNIT_WORKHOURS"].ToString());//单位工时
                        AD34_Seal_Outer_Ear_400 = double.Parse(string.IsNullOrEmpty(drHours["ATTACH_WORKHOURS"].ToString()) ? "0" : drHours["ATTACH_WORKHOURS"].ToString());//附加工时
                        break;
                    case "封外耳401":
                        WD34_Seal_Outer_Ear_401 = double.Parse(string.IsNullOrEmpty(drHours["UNIT_WORKHOURS"].ToString()) ? "0" : drHours["UNIT_WORKHOURS"].ToString());//单位工时
                        AD34_Seal_Outer_Ear_401 = double.Parse(string.IsNullOrEmpty(drHours["ATTACH_WORKHOURS"].ToString()) ? "0" : drHours["ATTACH_WORKHOURS"].ToString());//附加工时
                        break;
                    case "封外缺300":
                        WD34_Outside_Seal_300 = double.Parse(string.IsNullOrEmpty(drHours["UNIT_WORKHOURS"].ToString()) ? "0" : drHours["UNIT_WORKHOURS"].ToString());//单位工时
                        AD34_Outside_Seal_300 = double.Parse(string.IsNullOrEmpty(drHours["ATTACH_WORKHOURS"].ToString()) ? "0" : drHours["ATTACH_WORKHOURS"].ToString());//附加工时
                        break;
                    case "封外缺500":
                        WD34_Outside_Seal_500 = double.Parse(string.IsNullOrEmpty(drHours["UNIT_WORKHOURS"].ToString()) ? "0" : drHours["UNIT_WORKHOURS"].ToString());//单位工时
                        AD34_Outside_Seal_500 = double.Parse(string.IsNullOrEmpty(drHours["ATTACH_WORKHOURS"].ToString()) ? "0" : drHours["ATTACH_WORKHOURS"].ToString());//附加工时
                        break;
                    case "封外缺501":
                        WD34_Outside_Seal_501 = double.Parse(string.IsNullOrEmpty(drHours["UNIT_WORKHOURS"].ToString()) ? "0" : drHours["UNIT_WORKHOURS"].ToString());//单位工时
                        AD34_Outside_Seal_501 = double.Parse(string.IsNullOrEmpty(drHours["ATTACH_WORKHOURS"].ToString()) ? "0" : drHours["ATTACH_WORKHOURS"].ToString());//附加工时
                        break;
                    case "槽侧边擦色":
                        WD34_Groove_Side_Rubbing = double.Parse(string.IsNullOrEmpty(drHours["UNIT_WORKHOURS"].ToString()) ? "0" : drHours["UNIT_WORKHOURS"].ToString());//单位工时
                        AD34_Groove_Side_Rubbing = double.Parse(string.IsNullOrEmpty(drHours["ATTACH_WORKHOURS"].ToString()) ? "0" : drHours["ATTACH_WORKHOURS"].ToString());//附加工时
                        break;
                    case "打铜头胶塞":
                        WD34_Copper_Head_Plug = double.Parse(string.IsNullOrEmpty(drHours["UNIT_WORKHOURS"].ToString()) ? "0" : drHours["UNIT_WORKHOURS"].ToString());//单位工时
                        AD34_Copper_Head_Plug = double.Parse(string.IsNullOrEmpty(drHours["ATTACH_WORKHOURS"].ToString()) ? "0" : drHours["ATTACH_WORKHOURS"].ToString());//附加工时
                        break;
                    case "拧带齿螺母":
                        WD34_Twisted_Tooth_Nut = double.Parse(string.IsNullOrEmpty(drHours["UNIT_WORKHOURS"].ToString()) ? "0" : drHours["UNIT_WORKHOURS"].ToString());//单位工时
                        AD34_Twisted_Tooth_Nut = double.Parse(string.IsNullOrEmpty(drHours["ATTACH_WORKHOURS"].ToString()) ? "0" : drHours["ATTACH_WORKHOURS"].ToString());//附加工时
                        break;
                    case "贴美时LOGO":
                        WD34_LOGO = double.Parse(string.IsNullOrEmpty(drHours["UNIT_WORKHOURS"].ToString()) ? "0" : drHours["UNIT_WORKHOURS"].ToString());//单位工时
                        AD34_LOGO = double.Parse(string.IsNullOrEmpty(drHours["ATTACH_WORKHOURS"].ToString()) ? "0" : drHours["ATTACH_WORKHOURS"].ToString());//附加工时
                        break;
                    case "装屏风挂码":
                        WD34_Mounting_Screen_Hanging_Code = double.Parse(string.IsNullOrEmpty(drHours["UNIT_WORKHOURS"].ToString()) ? "0" : drHours["UNIT_WORKHOURS"].ToString());//单位工时
                        AD34_Mounting_Screen_Hanging_Code = double.Parse(string.IsNullOrEmpty(drHours["ATTACH_WORKHOURS"].ToString()) ? "0" : drHours["ATTACH_WORKHOURS"].ToString());//附加工时
                        break;
                    case "装装饰孔盖":
                        WD34_Decorative_Hole_Cover = double.Parse(string.IsNullOrEmpty(drHours["UNIT_WORKHOURS"].ToString()) ? "0" : drHours["UNIT_WORKHOURS"].ToString());//单位工时
                        AD34_Decorative_Hole_Cover = double.Parse(string.IsNullOrEmpty(drHours["ATTACH_WORKHOURS"].ToString()) ? "0" : drHours["ATTACH_WORKHOURS"].ToString());//附加工时
                        break;
                    case "贴通用标签":
                        WD34_General_Label = double.Parse(string.IsNullOrEmpty(drHours["UNIT_WORKHOURS"].ToString()) ? "0" : drHours["UNIT_WORKHOURS"].ToString());//单位工时
                        AD34_General_Label = double.Parse(string.IsNullOrEmpty(drHours["ATTACH_WORKHOURS"].ToString()) ? "0" : drHours["ATTACH_WORKHOURS"].ToString());//附加工时
                        break;
                    case "贴白色胶纸":
                        WD34_Paste_White_Adhesive_Paper = double.Parse(string.IsNullOrEmpty(drHours["UNIT_WORKHOURS"].ToString()) ? "0" : drHours["UNIT_WORKHOURS"].ToString());//单位工时
                        AD34_Paste_White_Adhesive_Paper = double.Parse(string.IsNullOrEmpty(drHours["ATTACH_WORKHOURS"].ToString()) ? "0" : drHours["ATTACH_WORKHOURS"].ToString());//附加工时
                        break;
                    case "锁自攻螺丝":
                        WD34_Lock_Self_Tapping_Screw = double.Parse(string.IsNullOrEmpty(drHours["UNIT_WORKHOURS"].ToString()) ? "0" : drHours["UNIT_WORKHOURS"].ToString());//单位工时
                        AD34_Lock_Self_Tapping_Screw = double.Parse(string.IsNullOrEmpty(drHours["ATTACH_WORKHOURS"].ToString()) ? "0" : drHours["ATTACH_WORKHOURS"].ToString());//附加工时
                        break;
                    case "贴双面胶纸":
                        WD34_Double_Sided_Adhesive_Paper = double.Parse(string.IsNullOrEmpty(drHours["UNIT_WORKHOURS"].ToString()) ? "0" : drHours["UNIT_WORKHOURS"].ToString());//单位工时
                        AD34_Double_Sided_Adhesive_Paper = double.Parse(string.IsNullOrEmpty(drHours["ATTACH_WORKHOURS"].ToString()) ? "0" : drHours["ATTACH_WORKHOURS"].ToString());//附加工时
                        break;
                }
            }
            //获取特征输入值
            foreach (var drData in dr1)
            {
                Tw1 = double.Parse(string.IsNullOrEmpty(drData["Width_1"].ToString().Replace("*", "")) ? "0" : drData["Width_1"].ToString().Replace("*", ""));//W1
                Tw2 = double.Parse(string.IsNullOrEmpty(drData["Width_2"].ToString().Replace("*", "")) ? "0" : drData["Width_2"].ToString().Replace("*", ""));//w2
                Td1 = double.Parse(string.IsNullOrEmpty(drData["Depth_1"].ToString().Replace("*", "")) ? "0" : drData["Depth_1"].ToString().Replace("*", ""));//d1
                Td2 = double.Parse(string.IsNullOrEmpty(drData["Depth_2"].ToString().Replace("*", "")) ? "0" : drData["Depth_2"].ToString().Replace("*", ""));//d2

                TD34_Coefficient_Width_W1 = double.Parse(string.IsNullOrEmpty(drData["D34_Coefficient_Width_W1"].ToString()) ? "0" : drData["D34_Coefficient_Width_W1"].ToString());//系数阔度W1
                TD34_Coefficient_Width_W2 = double.Parse(string.IsNullOrEmpty(drData["D34_Coefficient_Width_W2"].ToString()) ? "0" : drData["D34_Coefficient_Width_W2"].ToString());//系数阔度W2
                TD34_Coefficient_Depth_D1 = double.Parse(string.IsNullOrEmpty(drData["D34_Coefficient_Depth_D1"].ToString()) ? "0" : drData["D34_Coefficient_Depth_D1"].ToString());//系数深度D1
                TD34_Coefficient_Depth_D2 = double.Parse(string.IsNullOrEmpty(drData["D34_Coefficient_Depth_D2"].ToString()) ? "0" : drData["D34_Coefficient_Depth_D2"].ToString());//系数深度D2
                TD34_Coefficient_Angle_Z = double.Parse(string.IsNullOrEmpty(drData["D34_Coefficient_Angle_Z"].ToString()) ? "0" : drData["D34_Coefficient_Angle_Z"].ToString());//系数转角Z
                TD34_Copper_Head_Plug = double.Parse(string.IsNullOrEmpty(drData["D34_Copper_Head_Plug"].ToString()) ? "0" : drData["D34_Copper_Head_Plug"].ToString());//打铜头胶塞
                TD34_Twisted_Tooth_Nut = double.Parse(string.IsNullOrEmpty(drData["D34_Twisted_Tooth_Nut"].ToString()) ? "0" : drData["D34_Twisted_Tooth_Nut"].ToString());//拧带齿螺母
                TD34_Inside_the_Seal_700 = double.Parse(string.IsNullOrEmpty(drData["D34_Inside_the_Seal_700"].ToString()) ? "0" : drData["D34_Inside_the_Seal_700"].ToString());//D34_封内缺700
                TD34_Inside_the_Seal_701 = double.Parse(string.IsNullOrEmpty(drData["D34_Inside_the_Seal_701"].ToString()) ? "0" : drData["D34_Inside_the_Seal_701"].ToString());//D34_封内缺701
                TD34_Seal_Outer_Ear_200 = double.Parse(string.IsNullOrEmpty(drData["D34_Seal_Outer_Ear_200"].ToString()) ? "0" : drData["D34_Seal_Outer_Ear_200"].ToString());//D34_封外耳200
                TD34_Seal_Outer_Ear_400 = double.Parse(string.IsNullOrEmpty(drData["D34_Seal_Outer_Ear_400"].ToString()) ? "0" : drData["D34_Seal_Outer_Ear_400"].ToString());//D34_封外耳400
                TD34_Seal_Outer_Ear_401 = double.Parse(string.IsNullOrEmpty(drData["D34_Seal_Outer_Ear_401"].ToString()) ? "0" : drData["D34_Seal_Outer_Ear_401"].ToString());//D34_封外耳401
                TD34_Outside_Seal_300 = double.Parse(string.IsNullOrEmpty(drData["D34_Outside_Seal_300"].ToString()) ? "0" : drData["D34_Outside_Seal_300"].ToString());//D34_封外缺300
                TD34_Outside_Seal_500 = double.Parse(string.IsNullOrEmpty(drData["D34_Outside_Seal_500"].ToString()) ? "0" : drData["D34_Outside_Seal_500"].ToString());//D34_封外缺500
                TD34_Outside_Seal_501 = double.Parse(string.IsNullOrEmpty(drData["D34_Outside_Seal_501"].ToString()) ? "0" : drData["D34_Outside_Seal_501"].ToString());//D34_封外缺501
                TD34_Groove_Side_Rubbing = double.Parse(string.IsNullOrEmpty(drData["D34_Groove_Side_Rubbing"].ToString()) ? "0" : drData["D34_Groove_Side_Rubbing"].ToString());//D34_槽侧边擦色
                TD34_LOGO = double.Parse(string.IsNullOrEmpty(drData["D34_LOGO"].ToString()) ? "0" : drData["D34_LOGO"].ToString());//D34_贴美时LOGO
                TD34_Mounting_Screen_Hanging_Code = double.Parse(string.IsNullOrEmpty(drData["D34_Mounting_Screen_Hanging_Code"].ToString()) ? "0" : drData["D34_Mounting_Screen_Hanging_Code"].ToString());//D34_装屏风挂码
                TD34_Decorative_Hole_Cover = double.Parse(string.IsNullOrEmpty(drData["D34_Decorative_Hole_Cover"].ToString()) ? "0" : drData["D34_Decorative_Hole_Cover"].ToString());//D34_装屏风挂码
                TD34_General_Label = double.Parse(string.IsNullOrEmpty(drData["D34_General_Label"].ToString()) ? "0" : drData["D34_General_Label"].ToString());//D34_贴通用标签
                TD34_Paste_White_Adhesive_Paper = double.Parse(string.IsNullOrEmpty(drData["D34_Paste_White_Adhesive_Paper"].ToString()) ? "0" : drData["D34_Paste_White_Adhesive_Paper"].ToString());//D34_贴白色胶纸
                TD34_Lock_Self_Tapping_Screw = double.Parse(string.IsNullOrEmpty(drData["D34_Lock_Self_Tapping_Screw"].ToString()) ? "0" : drData["D34_Lock_Self_Tapping_Screw"].ToString());//D34_锁自攻螺丝
                TD34_Double_Sided_Adhesive_Paper = double.Parse(string.IsNullOrEmpty(drData["D34_Double_Sided_Adhesive_Paper"].ToString()) ? "0" : drData["D34_Double_Sided_Adhesive_Paper"].ToString());//D34_贴双面胶纸

            }
            //获取配件工时和缺口工时
            Tpj = WD34_Twisted_Tooth_Nut * TD34_Twisted_Tooth_Nut + WD34_Copper_Head_Plug * TD34_Copper_Head_Plug + WD34_Lock_Self_Tapping_Screw * TD34_Lock_Self_Tapping_Screw;
            Twqk = WD34_Seal_Outer_Ear_200 * TD34_Seal_Outer_Ear_200 + WD34_Seal_Outer_Ear_400 * TD34_Seal_Outer_Ear_400 + WD34_Seal_Outer_Ear_401 * TD34_Seal_Outer_Ear_401
                  + WD34_Outside_Seal_300 * TD34_Outside_Seal_300 + WD34_Outside_Seal_500 * TD34_Outside_Seal_500 + WD34_Outside_Seal_501 * TD34_Outside_Seal_501;
            Tnqk = WD34_Inside_the_Seal_700 * TD34_Inside_the_Seal_700 + WD34_Inside_the_Seal_701 * TD34_Inside_the_Seal_701;
            Tqf = WD34_Groove_Side_Rubbing * TD34_Groove_Side_Rubbing + WD34_LOGO * TD34_LOGO + WD34_Mounting_Screen_Hanging_Code * TD34_Mounting_Screen_Hanging_Code
                + WD34_Decorative_Hole_Cover * TD34_Decorative_Hole_Cover + WD34_General_Label * TD34_General_Label + WD34_Paste_White_Adhesive_Paper * TD34_Paste_White_Adhesive_Paper
                + WD34_Double_Sided_Adhesive_Paper * TD34_Double_Sided_Adhesive_Paper;
          
            switch (Types + Thickness)
            {
                #region L台或类似+2.0厚度
                case "L台或类似2.0":
                    Lcd = Tw1 * TD34_Coefficient_Width_W1 + Tw2 * TD34_Coefficient_Width_W2 + Td1 * TD34_Coefficient_Depth_D1 + Td2 * TD34_Coefficient_Depth_D2 + ((Tw1 + Tw2) - (Td1 + Td2)) * TD34_Coefficient_Angle_Z;
                    Tdz = 12 * (TD34_Coefficient_Width_W1 + TD34_Coefficient_Width_W2 + TD34_Coefficient_Depth_D1 + TD34_Coefficient_Depth_D2 + TD34_Coefficient_Angle_Z);               
                    if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tfb = (Lcd * 0.017) + 60 + Tdz;
                    }
                    else
                    {
                        Tfb = (Lcd * 0.017) + 60 + Tdz - (Tpj / 2);
                    }
                    //补充工时(Tbc)
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Tbc = Twqk + Tpj;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Tbc = Tnqk + Tpj;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tbc = Tnqk + Twqk;
                    }
                    else
                    {
                        Tbc = Tnqk + Twqk + Tpj;
                    }
                    //修边工时(Txb)
                    Txb = Lcd * 0.028 + 15;
                    //清洗工时(Tqx)
                    Tqx = 0.000085 * ((Tw1 * Tw2) - (Tw1 - Td1) * (Tw2 - Td2)) + 15 + Tqf;
                    //离岛工时(Tld)
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Tld = Tnqk;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Tld = Twqk;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tld = Tpj;
                    }
                    else
                    {
                        Tld = 0;
                    }
                    //配置人数Nrs
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Nrs = 7;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Nrs = 7;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Nrs = 7;
                    }
                    else
                    {
                        Nrs = 6;
                    }
                    //Total 工时
                    TD34 = Maximum(Tfb + Tbc, Txb, Tqx, Tld) * Nrs;
                    break;
                #endregion
                #region 圆台+2.0厚度
                case "圆台2.0":
                    Lcd = 3.14 * Tw1;
                    Tdz = 0;               
                //封边工时(Tfb)
                    if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tfb = (Lcd * 0.017) + 50 + Tdz;
                    }
                    else
                    {
                        Tfb = (Lcd * 0.017) + 50 + Tdz - (Tpj / 2);
                    }
                    //补充工时(Tbc)
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Tbc = Twqk + Tpj;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Tbc = Tnqk + Tpj;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tbc = Tnqk + Twqk;
                    }
                    else
                    {
                        Tbc = Tnqk + Twqk + Tpj;
                    }
                    //修边工时(Txb)
                    Txb = Lcd * 0.028 + 15 + 85;
                    //清洗工时(Tqx)
                    Tqx = 0.000085 * (Tw1 * Tw2 * 0.785) + 35 + Tqf;
                    //离岛工时(Tld)
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Tld = Tnqk;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Tld = Twqk;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tld = Tpj;
                    }
                    else
                    {
                        Tld = 0;
                    }
                    //配置人数Nrs
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Nrs = 7;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Nrs = 7;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Nrs = 7;
                    }
                    else
                    {
                        Nrs = 6;
                    }
                    //Total 工时
                    TD34 = Maximum(Tfb + Tbc, Txb, Tqx, Tld) * Nrs;
                    break;
                #endregion
                #region 仅1弧1接口+2.0厚度
                case "仅1弧1接口2.0":
                    Lcd = 2 * (Tw1 + Tw2);
                    Tdz = 0;                
                //封边工时(Tfb)
                    if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tfb = (Lcd * 0.017) + 60 + Tdz;
                    }
                    else
                    {
                        Tfb = (Lcd * 0.017) + 60 + Tdz - (Tpj / 2);
                    }
                    //补充工时(Tbc)
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Tbc = Twqk + Tpj;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Tbc = Tnqk + Tpj;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tbc = Tnqk + Twqk;
                    }
                    else
                    {
                        Tbc = Tnqk + Twqk + Tpj;
                    }
                    //修边工时(Txb)
                    Txb = Lcd * 0.028 + 15 + 85;
                    //清洗工时(Tqx)
                    Tqx = 0.000085 * (Tw1 * Tw2) + 35 + Tqf;
                    //离岛工时(Tld)
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Tld = Tnqk;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Tld = Twqk;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tld = Tpj;
                    }
                    else
                    {
                        Tld = 0;
                    }
                    //配置人数Nrs
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Nrs = 7;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Nrs = 7;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Nrs = 7;
                    }
                    else
                    {
                        Nrs = 6;
                    }
                    //Total 工时
                    TD34 = Maximum(Tfb + Tbc, Txb, Tqx, Tld) * Nrs;
                    break;
                #endregion
                #region 仅1弧1接口+0.6厚度
                case "仅1弧1接口0.6":
                    Lcd = 2 * (Tw1 + Tw2);
                    Tdz = 0;                
                    //封边工时(Tfb)
                    Tfb = Lcd * 0.06 + 30 + Tdz;
                    //补充工时(Tbc)
                    Tbc = Tnqk + Twqk;
                    //修边工时(Txb)
                    Txb = Lcd * 0 + 0 + 0;
                    //清洗工时(Tqx)
                    Tqx = 0.000085 * (Tw1 * Tw2) + 35 + Tqf;
                    //配置人数Nrs
                    Nrs = 4;
                    //Total 工时
                    TD34 = (NumMAX(Tfb + Tbc, Tpj) + Tqx) * Nrs / 2;
                    break;
                #endregion
                #region 3直带弧+2.0厚度
                case "3直带弧2.0":
                    Lcd = Tw1 * TD34_Coefficient_Width_W1 + Tw2 * TD34_Coefficient_Width_W2 + Td1 * TD34_Coefficient_Depth_D1 + Td2 * TD34_Coefficient_Depth_D2 + ((Tw1 + Tw2) - (Td1 + Td2)) * TD34_Coefficient_Angle_Z;
                    Tdz = 0;                 
                //封边工时(Tfb)
                    if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tfb = (Lcd * 0.017) + 50 + Tdz;
                    }
                    else
                    {
                        Tfb = (Lcd * 0.017) + 50 + Tdz - (Tpj / 2);
                    }
                    //补充工时(Tbc)
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Tbc = Twqk + Tpj;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Tbc = Tnqk + Tpj;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tbc = Tnqk + Twqk;
                    }
                    else
                    {
                        Tbc = Tnqk + Twqk + Tpj;
                    }
                    //修边工时(Txb)
                    Txb = Lcd * 0.028 + 15;
                    //清洗工时(Tqx)
                    Tqx = 0.000085 * (Tw1 * Tw2) + 15 + Tqf;
                    //离岛工时(Tld)
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Tld = Tnqk;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Tld = Twqk;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tld = Tpj;
                    }
                    else
                    {
                        Tld = 0;
                    }
                    //配置人数Nrs
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Nrs = 7;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Nrs = 7;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Nrs = 7;
                    }
                    else
                    {
                        Nrs = 6;
                    }
                    //Total 工时
                    TD34 = Maximum(Tfb + Tbc, Txb, Tqx, Tld) * Nrs;
                    break;
                #endregion
                #region 3直带弧+0.6厚度
                case "3直带弧0.6":
                   // Lcd = 2 * (Tw1 + Tw2);
                    Lcd = Tw1 * TD34_Coefficient_Width_W1 + Tw2 * TD34_Coefficient_Width_W2 + Td1 * TD34_Coefficient_Depth_D1 + Td2 * TD34_Coefficient_Depth_D2 + ((Tw1 + Tw2) - (Td1 + Td2)) * TD34_Coefficient_Angle_Z;
                    Tdz = 0;                
                    //封边工时(Tfb)
                    Tfb = Lcd * 0.02 + 30 + Tdz;
                    //补充工时(Tbc)
                    Tbc = Tnqk + Twqk;
                    //修边工时(Txb)
                    Txb = Lcd * 0 + 0 + 0;
                    //清洗工时(Tqx)
                    Tqx = 0.000085 * (Tw1 * Tw2) + 15 + Tqf;
                    //配置人数Nrs
                    Nrs = 4;
                    //Total 工时
                    TD34 = (NumMAX(Tfb + Tbc, Tpj) + Tqx) * Nrs / 2;
                    break;
                #endregion
                #region 2直带弧+2.0厚度
                case "2直带弧2.0":
                    Lcd = Tw1 * TD34_Coefficient_Width_W1 + Tw2 * TD34_Coefficient_Width_W2 + Td1 * TD34_Coefficient_Depth_D1 + Td2 * TD34_Coefficient_Depth_D2 + ((Tw1 + Tw2) - (Td1 + Td2)) * TD34_Coefficient_Angle_Z;
                    Tdz = 12;            
                    //封边工时(Tfb)
                    if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tfb = (Lcd * 0.017) + 50 + Tdz;
                    }
                    else
                    {
                        Tfb = (Lcd * 0.017) + 50 + Tdz - (Tpj / 2);
                    }
                    //补充工时(Tbc)
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Tbc = Twqk + Tpj;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Tbc = Tnqk + Tpj;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tbc = Tnqk + Twqk;
                    }
                    else
                    {
                        Tbc = Tnqk + Twqk + Tpj;
                    }
                    //修边工时(Txb)
                    Txb = Lcd * 0.028 + 15;
                    //清洗工时(Tqx)
                    Tqx = 0.000085 * (Tw1 * Tw2) + 15 + Tqf;
                    //离岛工时(Tld)
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Tld = Tnqk;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Tld = Twqk;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tld = Tpj;
                    }
                    else
                    {
                        Tld = 0;
                    }
                    //配置人数Nrs
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Nrs = 7;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Nrs = 7;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Nrs = 7;
                    }
                    else
                    {
                        Nrs = 6;
                    }
                    //Total 工时
                    TD34 = Maximum(Tfb + Tbc, Txb, Tqx, Tld) * Nrs;
                    break;
                #endregion
                #region 2直带弧+0.6厚度
                case "2直带弧0.6":
                    Lcd = Tw1 * TD34_Coefficient_Width_W1 + Tw2 * TD34_Coefficient_Width_W2 + Td1 * TD34_Coefficient_Depth_D1 + Td2 * TD34_Coefficient_Depth_D2 + ((Tw1 + Tw2) - (Td1 + Td2)) * TD34_Coefficient_Angle_Z;
                    Tdz = 12;                  
                    //封边工时(Tfb)
                    Tfb = Lcd * 0.02 + 30 + Tdz;
                    //补充工时(Tbc)
                    Tbc = Tnqk + Twqk;
                    //修边工时(Txb)
                    Txb = Lcd * 0 + 0 + 0;
                    //清洗工时(Tqx)
                    Tqx = 0.000085 * (Tw1 * Tw2) + 15 + Tqf;
                    //配置人数Nrs
                    Nrs = 4;
                    //Total 工时
                    TD34 = (NumMAX(Tfb + Tbc, Tpj) + Tqx) * Nrs / 2;
                    break;
                #endregion
                #region 1直带弧+2.0厚度
                case "1直带弧2.0":
                    Lcd = Tw1 * TD34_Coefficient_Width_W1 + Tw2 * TD34_Coefficient_Width_W2 + Td1 * TD34_Coefficient_Depth_D1 + Td2 * TD34_Coefficient_Depth_D2 + ((Tw1 + Tw2) - (Td1 + Td2)) * TD34_Coefficient_Angle_Z;
                    Tdz = 12 * (TD34_Coefficient_Width_W1 + TD34_Coefficient_Width_W2 + TD34_Coefficient_Depth_D1 + TD34_Coefficient_Depth_D2 + TD34_Coefficient_Angle_Z);                  
                    //封边工时(Tfb)
                    if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tfb = (Lcd * 0.017) + 60 + Tdz;
                    }
                    else
                    {
                        Tfb = (Lcd * 0.017) + 60 + Tdz - (Tpj / 2);
                    }
                    //补充工时(Tbc)
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Tbc = Twqk + Tpj;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Tbc = Tnqk + Tpj;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tbc = Tnqk + Twqk;
                    }
                    else
                    {
                        Tbc = Tnqk + Twqk + Tpj;
                    }
                    //修边工时(Txb)
                    Txb = Lcd * 0.028 + 15;
                    //清洗工时(Tqx)
                    Tqx = 0.000085 * (Tw1 * Tw2) + 15 + Tqf;
                    //离岛工时(Tld)
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Tld = Tnqk;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Tld = Twqk;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tld = Tpj;
                    }
                    else
                    {
                        Tld = 0;
                    }
                    //配置人数Nrs
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Nrs = 7;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Nrs = 7;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Nrs = 7;
                    }
                    else
                    {
                        Nrs = 6;
                    }
                    //Total 工时
                    TD34 = Maximum(Tfb + Tbc, Txb, Tqx, Tld) * Nrs;
                    break;
                #endregion
                #region 1直带弧+0.6厚度
                case "1直带弧0.6":
                   // Lcd = 12 * (TD34_Coefficient_Width_W1 + TD34_Coefficient_Width_W2 + TD34_Coefficient_Depth_D1 + TD34_Coefficient_Depth_D2 + TD34_Coefficient_Angle_Z);
                    Lcd = Tw1 * TD34_Coefficient_Width_W1 + Tw2 * TD34_Coefficient_Width_W2 + Td1 * TD34_Coefficient_Depth_D1 + Td2 * TD34_Coefficient_Depth_D2 + ((Tw1 + Tw2) - (Td1 + Td2)) * TD34_Coefficient_Angle_Z; 
                   Tdz = 0;                   
                    //封边工时(Tfb)
                    Tfb = Lcd * 0.02 + 30 + Tdz;
                    //补充工时(Tbc)
                    Tbc = Tnqk + Twqk;
                    //修边工时(Txb)
                    Txb = Lcd * 0 + 0 + 0;
                    //清洗工时(Tqx)
                    Tqx = 0.000085 * (Tw1 * Tw2) + 15 + Tqf;
                    //配置人数Nrs
                    Nrs = 4;
                    //Total 工时
                    TD34 = (NumMAX(Tfb + Tbc, Tpj) + Tqx) * Nrs / 2;
                    break;
                #endregion
                #region 全弧(4边或3边)+2.0厚度
                case "全弧(4边或3边)2.0":
                    Lcd = 2 * (Tw1 + Tw2);
                    Tdz = 86;                
                    //封边工时(Tfb)
                    if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tfb = (Lcd * 0.017) + 50 + Tdz;
                    }
                    else
                    {
                        Tfb = (Lcd * 0.017) + 50 + Tdz - (Tpj / 2);
                    }
                    //补充工时(Tbc)
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Tbc = Twqk + Tpj;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Tbc = Tnqk + Tpj;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tbc = Tnqk + Twqk;
                    }
                    else
                    {
                        Tbc = Tnqk + Twqk + Tpj;
                    }
                    //修边工时(Txb)
                    Txb = Lcd * 0.028 + 15;
                    //清洗工时(Tqx)
                    Tqx = 0.000085 * (Tw1 * Tw2) + 15 + Tqf;
                    //离岛工时(Tld)
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Tld = Tnqk;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Tld = Twqk;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tld = Tpj;
                    }
                    else
                    {
                        Tld = 0;
                    }
                    //配置人数Nrs
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Nrs = 7;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Nrs = 7;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Nrs = 7;
                    }
                    else
                    {
                        Nrs = 6;
                    }
                    //Total 工时
                    TD34 = Maximum(Tfb + Tbc, Txb, Tqx, Tld) * Nrs;
                    break;
                #endregion
                #region 120台+2.0厚度
                case "120台2.0":
                    Lcd = Tw1 * TD34_Coefficient_Width_W1 + Tw2 * TD34_Coefficient_Width_W2 + Td1 * TD34_Coefficient_Depth_D1 + Td2 * TD34_Coefficient_Depth_D2 + ((Tw1 + Tw2) - (Td1 + Td2)) * TD34_Coefficient_Angle_Z;
                    Tdz = 12 * (TD34_Coefficient_Width_W1 + TD34_Coefficient_Width_W2 + TD34_Coefficient_Depth_D1 + TD34_Coefficient_Depth_D2 + TD34_Coefficient_Angle_Z);                
                    //封边工时(Tfb)
                    if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tfb = (Lcd * 0.017) + 60 + Tdz;
                    }
                    else
                    {
                        Tfb = (Lcd * 0.017) + 60 + Tdz - (Tpj / 2);
                    }
                    //补充工时(Tbc)
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Tbc = Twqk + Tpj;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Tbc = Tnqk + Tpj;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tbc = Tnqk + Twqk;
                    }
                    else
                    {
                        Tbc = Tnqk + Twqk + Tpj;
                    }
                    //修边工时(Txb)
                    Txb = Lcd * 0.028 + 15;
                    //清洗工时(Tqx)
                    Tqx = 0.000085 * (Tw1 + Tw2 - (0.577 * Td1)) * Td1 + 15 + Tqf;
                    //离岛工时(Tld)
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Tld = Tnqk;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Tld = Twqk;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tld = Tpj;
                    }
                    else
                    {
                        Tld = 0;
                    }
                    //配置人数Nrs
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Nrs = 7;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Nrs = 7;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Nrs = 7;
                    }
                    else
                    {
                        Nrs = 6;
                    }
                    //Total 工时
                    TD34 = Maximum(Tfb + Tbc, Txb, Tqx, Tld) * Nrs;
                    break;
                #endregion
                #region 4边以上不分直弧边+2.0厚度
                case "4边以上不分直弧边2.0":
                    Lcd = Tw1 * TD34_Coefficient_Width_W1 + Tw2 * TD34_Coefficient_Width_W2 + Td1 * TD34_Coefficient_Depth_D1 + Td2 * TD34_Coefficient_Depth_D2 + ((Tw1 + Tw2) - (Td1 + Td2)) * TD34_Coefficient_Angle_Z;
                    Tdz = 80;                
                    //封边工时(Tfb)
                    if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tfb = (Lcd * 0.017) + 60 + Tdz;
                    }
                    else
                    {
                        Tfb = (Lcd * 0.017) + 60 + Tdz - (Tpj / 2);
                    }
                    //补充工时(Tbc)
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Tbc = Twqk + Tpj;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Tbc = Tnqk + Tpj;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tbc = Tnqk + Twqk;
                    }
                    else
                    {
                        Tbc = Tnqk + Twqk + Tpj;
                    }
                    //修边工时(Txb)
                    Txb = Lcd * 0.028 + 15;
                    //清洗工时(Tqx)
                    Tqx = 0.000085 * (Tw1 * Tw2) + 15 + Tqf;
                    //离岛工时(Tld)
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Tld = Tnqk;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Tld = Twqk;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tld = Tpj;
                    }
                    else
                    {
                        Tld = 0;
                    }
                    //配置人数Nrs
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Nrs = 7;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Nrs = 7;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Nrs = 7;
                    }
                    else
                    {
                        Nrs = 6;
                    }
                    //Total 工时
                    TD34 = Maximum(Tfb + Tbc, Txb, Tqx, Tld) * Nrs;
                    break;
                #endregion
                #region 轮廓不封边+0厚度
                case "轮廓不封边0.0":
                    Tdz = 0;                
                    //封边工时(Tfb)
                    Tfb = 0;
                    //补充工时(Tbc)
                    Tbc = Tnqk + Twqk;
                    //修边工时(Txb)
                    Txb = 0;
                    //清洗工时(Tqx)
                    Tqx = 0.000085 * (Tw1 * Tw2) + 15 + Tqf;
                    //配置人数Nrs
                    Nrs = 4;
                    //Total 工时
                    if (Tfb + Tbc == 0)
                    {
                        TD34 = Tpj + (Tqx * Nrs / 2);
                    }
                    else
                    {
                        TD34 = (NumMAX(Tfb + Tbc, Tpj) + Tqx) * Nrs / 2;
                    }

                    break;
                #endregion
            }
            return TD34;
        }
        //四个数取最大值
        public double Maximum(double x, double y, double z, double h)
        {
            double maximumValue = x;
            if (y > maximumValue)
                maximumValue = y;
            if (z > maximumValue)
                maximumValue = z;
            if (h > maximumValue)
                maximumValue = h;
            return maximumValue;
        }
        //二个数取最大值
        private static double NumMAX(double Tw1, double Tw2)
        {
            if (Tw1 > Tw2)
            {
                return Tw1;
            }
            return Tw2;
        }
    }
}
